<template>
  <div class="statistical">
    <div class="header">
      <span>{{ panelData.titleB }}</span>
      <el-tooltip :content="panelData.titleB" placement="top" effect="light">
        <el-icon><WarningFilled /></el-icon>
      </el-tooltip>
    </div>
    <div class="content">
      <hy-counter-up :number="panelData.numB" :option="counterOption" />
    </div>
    <div class="footer">
      <span>
        {{ panelData.titleS }}
        <hy-counter-up :number="panelData.numS" :option="counterOption" />
      </span>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { defineProps } from 'vue'
import HyCounterUp from '@/baseUI/count-up'
import type panelDataType from './types'
import { WarningFilled } from '@element-plus/icons-vue'
const props = defineProps<{
  panelData: panelDataType
}>()

const counterOption = {
  decimalPlaces: 0, // 保留两位
  prefix: '' // 单位
}
</script>

<style scoped lang="less">
@h: 38px;

.statistical {
  display: flex;
  padding: 0 20px;
  background: white;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: 0 2px 8px 0 rgba(146, 146, 146, 0.1);

  height: 130px;
  margin-bottom: 20px;
  overflow: hidden;
  text-align: left;

  .header {
    display: flex;
    height: @h;
    font-size: 14px;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.45);
    // border: 1px solid red;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }

  .content {
    display: flex;
    margin-left: 0px;
    font-size: 26px;
    color: rgba(0, 0, 0, 0.85);
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }

  .footer {
    display: flex;
    height: @h;
    font-size: 14px;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.85);
    border-top: 1px solid #f0f0f0;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }
}
</style>
